<template>
    <div class="app_goods_list" @scroll="onScroll($event)">
        <div class="top">
            <div id='oplist'>
                <div class="op" :class="sort==0?'activate':''" id="sort_0" @click="setsort(0)">综合</div>
                <div class="op" :class="sort==1?'activate':''"  id="sort_1" @click="setsort(1)">销量</div>
                <div class="op" :class="sort==2?'activate':''"  id="sort_2" @click="setsort(2)">价格</div>
            </div>
        </div>

        <div id="list">
            <div class="goods_list">
                <div v-for='(item,index) in list' :key='index' class="goods_item">
                    <router-link class="goods" :to="'/pages/goods/detail?id='+item.id">
                        <div class="pic"><img :src="resurl+item.pic+'?x-oss-process=image/resize,m_fill,w_240,h_240'"
                                              alt=""></div>
                        <div class="info">
                            <div class="name">{{item.name}}</div>
                            <div class="sales">销量:{{item.sales}}</div>
                            <div class="price">￥{{item.price}}</div>
                        </div>
                    </router-link>
                    <div class="golist">
                        <div v-for="(goitem,goindex) in item.golist" class="go">
                            <div class="endtime_str endtime" v-html="goitem.endtime_str"></div>
                            <div class="price">团购价格: <span>￥{{goitem.price}}</span></div>
                            <div class="number">参团人数:{{goitem.current_number}}/{{goitem.number}}</div>
                            <router-link class="btn" :to="'/pages/go/detail?id='+goitem.id">立即参团</router-link>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</template>

<script src="./main.js"></script>

<style lang="less" src="./main.less" scoped></style>
